# -*- coding: utf-8 -*-

import urlparse
url = urlparse.urljoin('http://localhost:8080','/tmp/')
print url
urlpr = urlparse.urlsplit(url)
print urlpr
print urlparse.urlunsplit(urlpr)

import urllib
print urllib.quote('zip&zap')
print urllib.urlencode([('K',('x','y','hz'))],True)
print urllib.urlencode([('K',('x','y','z'))],False)
url = 'http://www.baidu.com'
page = urllib.urlopen(url)
print page.geturl()
page.close()

page = urllib.urlretrieve(url, '../htmlfiles/data.html')
